<template>
  <div>
    <el-card>
      <!-- 头部 -->
      <div slot="header" class="header">
        <span><i class="el-icon-d-arrow-left" @click="toBack"></i>商户:你好</span>
        <template>
          <el-select v-model="value" placeholder="设置" size='mini'>
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </template>
      </div>
      <!-- 内容 -->
      <el-table :data="itemInfo" style="width: 100%">
        <el-table-column prop="id" label="ID" width="width">
        </el-table-column>
        <el-table-column prop="name" label="名称" width="width">
        </el-table-column>
        <el-table-column prop="owner.displayName" label="所有人" width="width">
        </el-table-column>
        <el-table-column prop="merchantStatus.displayName" label="商户状态" width="width">
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间" width="width">
        </el-table-column>
        <el-table-column prop="lastUpdateTime" label="最后更新时间" width="width">
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "Detail",
  data() {
    return {
      // 设置
      options: [
        {
          value: "选项1",
          label: "权限",
        },
      ],
      // 当前点击的对象信息
      itemInfo: [],
      value: "",
    };
  },
  mounted() {
    // 接收传递过来的数据
    this.$bus.$on("showDetail", this.showDetail);
  },
  methods: {
    // 将传递过来的数据进行赋值
    showDetail(row) {
      this.itemInfo = row;
    },
    // 点击箭头返回页面
    toBack(){
      this.$emit('toback')
    }
  },
};
</script>

<style lang='scss' scoped>
// 头部文字和图表
.header {
  font-size: 20px;
  display: flex;
  justify-content: space-between;
  span{
    .el-icon-d-arrow-left {
      color: #40a9ff;
      font-weight: bold;
      margin-right: 20px;
    }
  }
}
// 设置下拉框
::v-deep .el-input__inner {
  width: 80px;
  border: 1px solid #d9d9d9;
}
</style>
